Skip to content

Feat/merged bitwise bus#481

Closed
diegokingston wants to merge 19 commits into
mainfrom
feat/merged-bitwise-bus
Closed

Feat/merged bitwise bus#481
diegokingston wants to merge 19 commits into
mainfrom
feat/merged-bitwise-bus

Conversation

@diegokingston

Copy link
Copy Markdown
Collaborator

No description provided.

jotabulacios and others added 13 commits April 6, 2026 10:11
…yte)

Merges 3 separate byte-level bitwise buses into 1 with op_type
discriminant. Reduces CPU interactions from 24 to 8, saving ~8 aux
columns. Affects CPU, bitwise, shift, and potentially memw_aligned tables.
Replace three separate BusId variants (AndByte=3, OrByte=4, XorByte=5)
with a single BitwiseByte=3 variant using an op_type discriminant field
(0=AND, 1=OR, 2=XOR). Renumber subsequent variants accordingly.
Replace three separate BusId::AndByte/OrByte/XorByte receivers with three
BitwiseByte receivers distinguished by a constant op_type field:
  AND receiver: op_type=0, OR receiver: op_type=1, XOR receiver: op_type=2

MU_AND, MU_OR, MU_XOR multiplicity columns remain separate and unchanged.
Adds LinearTerm to import.
Replace three separate 8-iteration loops (AND_BYTE, OR_BYTE, XOR_BYTE)
with a single merged loop over BitwiseByte using:
  - Multiplicity::Sum3(AND, OR, XOR)  (at most 1 active per cycle)
  - op_type field: 1*OR + 2*XOR (so AND=0, OR=1, XOR=2)

This reduces CPU bus interactions from 24 to 8. AND/OR/XOR are mutually
exclusive per cycle (enforced by DECODE), so Sum3 acts as a single active
multiplicity.
Update SHIFT-C1, SHIFT-C2, and SHIFT-C11 interactions from BusId::AndByte
to BusId::BitwiseByte, adding a constant op_type=0 (AND) as the 4th bus
field to match the merged bus protocol.
…type=0

Update the alignment-check bus interaction from BusId::AndByte to
BusId::BitwiseByte, adding a constant op_type=0 (AND) as the 4th field.
Update the PC alignment AND_BYTE interaction to BusId::BitwiseByte with
a constant op_type=0 (AND) as the 4th bus field.
Update standalone bus interaction tests in bitwise_bus_tests.rs and
bitwise_tests.rs to use BusId::BitwiseByte with a constant op_type=0
on both sender and receiver sides (both test AND operations). Add
LinearTerm to imports where missing.
@diegokingston

Copy link
Copy Markdown
Collaborator Author

/bench 3

@github-actions

github-actions Bot commented Apr 8, 2026

Copy link
Copy Markdown

Benchmark — fib_iterative_8M (median of 3)

Table parallelism: 32 (auto = cores / 3)

Metric main PR Δ
Peak heap 220860 MB 193079 MB -27781 MB (-12.6%) 🟢
Prove time 47.123s 43.438s -3.685s (-7.8%) 🟢

🎉 Improvement detected — heap or time decreased by more than 5%.

✅ Low variance (time: 1.0%, heap: 0.1%)

Commit: fe2fe55 · Baseline: cached · Runner: self-hosted bench

@jotabulacios

Copy link
Copy Markdown
Collaborator

/bench

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants